package com.yun.zf.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yun.zf.common.admin.domain.ZfDeptCommunity;
import com.yun.zf.common.admin.dto.community.AgentInfoDto;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 三级门店与小区关系表 Mapper 接口
 * </p>
 *
 * @author cj
 * @since 2021-05-26
 */
public interface ZfDeptCommunityMapper extends BaseMapper<ZfDeptCommunity> {

    @Select("<script>" +
            " SELECT  `name` ,iphone , agent_no,avatar, dept_name   from sys_agent a WHERE a.dept_id in ( " +
            "SELECT dept3_id from zf_dept_community dc WHERE dc.community_id =#{communityId}) " +
            "</script>")
    public List<AgentInfoDto> getInfo(Long communityId);
}
